<?php
header("Content-Type:text/html;charset=UTF-8");
$str='<a href="test.html">测试页面</a>';
echo htmlentities($str);

$str='<a href="test.html">测试页面</a>';
echo htmlspecialchars($str);
?>